﻿using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using HDJ.Framework.Core;

public class TestWindows : EditorWindow
{
    [MenuItem("Tools/TestWindows")]
    static void DoIt()
    {
        GetWindow<TestWindows>();
       // EditorUtility.DisplayDialog("MyTool", "Do It in C# !", "OK", "");
    }
    int mask;
    string[] displayedOptions = new string[] {"123","Test", "displayedOptions" ,"124","126","127","128","129","130","111"};
    Rect rect;
    bool foldout;
    float slider;
    private bool toggle;
    private FocusType focusType;
    string ss;
    //InputModel temp = new InputModel();
    Dictionary<string, int> dictionary = new Dictionary<string, int>() ;
    private void OnGUI()
    {
        if (GUILayout.Button("BBB"))
        {
            dictionary.Add("1", 100);
        }
        dictionary = (Dictionary<string, int>)EditorDrawGUIUtil.DrawBaseValue("Dic :", dictionary);

        //temp = (InputModel)EditorDrawGUIUtil.DrawBaseValue("temp :", temp);
        //slider = EditorGUILayout.Slider(slider,0,1);
        //foldout = EditorGUILayout.BeginFadeGroup(slider);
        //toggle = EditorGUILayout.BeginToggleGroup("BeginToggleGroup", toggle);
        //EditorGUILayout.PrefixLabel("PrefixLabel");
        //mask = EditorGUILayout.MaskField("MaskField", mask, displayedOptions);

        //rect = EditorGUILayout.RectField("RectField", rect);

        //foldout = EditorGUILayout.InspectorTitlebar(foldout, this,true);
        //EditorGUILayout.EndToggleGroup();
        //EditorGUILayout.EndFadeGroup();
        ////Rect r = GUILayoutUtility.GetRect(Screen.width, 60); //GUILayoutUtility.GetLastRect();

        ////EditorGUI.DrawRect(r, Color.red);
        ss = EditorDrawGUIUtil.DrawSearchFieldSelect("SearchFieldSelect", ss, displayedOptions, (s) =>
      {

          Debug.Log("Select :" + Application.platform);
      });
        //if (EditorGUILayout.DropdownButton(new GUIContent("DropdownButton"), focusType))
        //{
        //    toggle = !toggle;
        //}

        //slider = EditorGUILayout.DelayedFloatField(slider);
        ////  EditorGUIUtility
        //focusType = (FocusType)EditorGUILayout.EnumFlagsField(focusType);

        if (GUILayout.Button("Sort"))
        {
            Debug.Log(OtherUtils.CompareVersions(v0, v1));
        }

        v0 = EditorDrawGUIUtil.DrawBaseValue("v0", v0).ToString();
        v1 = EditorDrawGUIUtil.DrawBaseValue("v1", v1).ToString();

        oooo = (List<List<List<int>>>)EditorDrawGUIUtil.DrawBaseValue("v0", oooo);

        pppp =(int[][][])EditorDrawGUIUtil.DrawBaseValue("pppp", pppp);
    }
    private List<List<List<int>>> oooo = new List<List<List<int>>>();
    private int[][][] pppp = new int[0][][];
    private string v0="";

    private string v1 = "";
}